/*
	This file is part of PropExtractor.

	PropExtractor is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	PropExtractor is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with PropExtractor. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _PEALICESOFTIMAGEJPG_H_
#define _PEALICESOFTIMAGEJPG_H_

namespace pe
{

	struct PEStream;

	struct AliceImageJpgHeader
	{
		byte header[4];
		word length;
		byte ident[5];
		word version;
		byte density;
		word width;
		word height;
		byte thumbnail_width;
		byte thumbnail_height;
	};

	struct AliceImageJpg
	{
		AliceImageJpgHeader* header;

		unsigned int width, height;
		byte* data;
		unsigned int data_length;
	};

	PE_EXPORT int AliceImageJpgReadHeader(AliceImageJpgHeader* a_Target, PEStream* a_Stream);
	PE_EXPORT int AliceImageJpgReadData(AliceImageJpg* a_Target, AliceImageJpgHeader* a_Header, PEStream* a_Stream);
	PE_EXPORT int AliceImageJpgToRaw(PEImageRaw* a_Target, AliceImageJpg* a_Image);

	PE_EXPORT int AliceImageJpgReadAndDecrypt(PEImageRaw* a_Target, PEStream* a_Stream);

	PE_EXPORT int AliceImageJpgDeleteHeader(AliceImageJpgHeader* a_Header);
	PE_EXPORT int AliceImageJpgDeleteData(AliceImageJpg* a_Image);

}; // namespace pe

#endif